PATHMac OS 8 and 9 Developer Documentation > Networking and Communications > URL Access Manager >

Transferring Files With the URL Access Manager


URLGetDataAvailable

Obtains the amount of data available for retrieval in a download operation.

OSStatus URLGetDataAvailable (
                     URLReference urlRef,
                     Size *dataSize);
urlRef
A reference of type URLReference that identifies the URL whose buffer size you want. Call URLNewReference to create the reference.
dataSize
A pointer to a value of type Size . On return, dataSize is set to the number of bytes that can be retrieved. For more information on the Size type, see Inside Macintosh: Memory .
function result
A result code. For a list of possible result codes, see Result Codes .

DISCUSSION

The URLGetDataAvailable function obtains the amount of data in bytes that is available for your application to retrieve. This function returns meaningful data only if you have initiated a download process.

IMPORTANT

The URLGetDataAvailable function returns only the number of bytes in buffers that remain after you have already copied data from buffers by calling URLGetBuffer . The number returned does not include the number of bytes in transit to a buffer, nor does it include the amount of data not yet transferred from the URL.

This function returns the amount of data remaining in buffers, so do not use it to calculate the amount of remaining data to be downloaded. To determine the amount of data remaining to be downloaded, call URLGetProperty and specify the kURLResourceSize property in URLCallbackInfo . You can then subtract the amount of data copied by URLGetBuffer to determine the amount of data remaining to be transferred to your application.


© 1999 Apple Computer, Inc. – (Last Updated 07 May 99)